package com.sptan.framework.exception;


import org.springframework.http.HttpStatus;

/**
 * Description: 请求参数异常 .
 *
 * @author lp
 */
public class BadRequestException extends RuntimeException {

    private static final long serialVersionUID = 1L;

    private Integer code;

    /**
     * Instantiates a new Bad request exception.
     *
     * @param code    the code
     * @param message the message
     */
    public BadRequestException(Integer code, String message) {
        super(message);
        this.code = code;
    }


    /**
     * Instantiates a new Bad request exception.
     *
     * @param message the message
     */
    public BadRequestException(String message) {
        super(message);
        this.code = HttpStatus.BAD_REQUEST.value();
    }

    /**
     * Gets code.
     *
     * @return the code
     */
    public Integer getCode() {
        return code;
    }

    /**
     * Sets code.
     *
     * @param code the code
     */
    public void setCode(Integer code) {
        this.code = code;
    }
}
